home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / NFSD / XDR.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  4KB  |  160 lines

  1. /*
  2.  * linux/inxlude/linux/nfsd/xdr.h
  3.  *
  4.  * XDR types for nfsd. This is mainly a typing exercise.
  5.  */
  6.  
  7. #ifndef LINUX_NFSD_H
  8. #define LINUX_NFSD_H
  9.  
  10. #include <linux/fs.h>
  11. #include <linux/nfs.h>
  12.  
  13. struct nfsd_fhandle {
  14.     struct svc_fh        fh;
  15. };
  16.  
  17. struct nfsd_sattrargs {
  18.     struct svc_fh        fh;
  19.     struct iattr        attrs;
  20. };
  21.  
  22. struct nfsd_diropargs {
  23.     struct svc_fh        fh;
  24.     char *            name;
  25.     int            len;
  26. };
  27.  
  28. struct nfsd_readargs {
  29.     struct svc_fh        fh;
  30.     __u32            offset;
  31.     __u32            count;
  32.     __u32            totalsize;
  33. };
  34.  
  35. struct nfsd_writeargs {
  36.     svc_fh            fh;
  37.     __u32            beginoffset;
  38.     __u32            offset;
  39.     __u32            totalcount;
  40.     __u8 *            data;
  41.     int            len;
  42. };
  43.  
  44. struct nfsd_createargs {
  45.     struct svc_fh        fh;
  46.     char *            name;
  47.     int            len;
  48.     struct iattr        attrs;
  49. };
  50.  
  51. struct nfsd_renameargs {
  52.     struct svc_fh        ffh;
  53.     char *            fname;
  54.     int            flen;
  55.     struct svc_fh        tfh;
  56.     char *            tname;
  57.     int            tlen;
  58. };
  59.  
  60. struct nfsd_linkargs {
  61.     struct svc_fh        ffh;
  62.     struct svc_fh        tfh;
  63.     char *            tname;
  64.     int            tlen;
  65. };
  66.  
  67. struct nfsd_symlinkargs {
  68.     struct svc_fh        ffh;
  69.     char *            fname;
  70.     int            flen;
  71.     char *            tname;
  72.     int            tlen;
  73.     struct iattr        attrs;
  74. };
  75.  
  76. struct nfsd_readdirargs {
  77.     struct svc_fh        fh;
  78.     __u32            cookie;
  79.     __u32            count;
  80. };
  81.  
  82. struct nfsd_attrstat {
  83.     struct svc_fh        fh;
  84. };
  85.  
  86. struct nfsd_diropres  {
  87.     struct svc_fh        fh;
  88. };
  89.  
  90. struct nfsd_readlinkres {
  91.     int            len;
  92. };
  93.  
  94. struct nfsd_readres {
  95.     struct svc_fh        fh;
  96.     unsigned long        count;
  97. };
  98.  
  99. struct nfsd_readdirres {
  100.     int            count;
  101. };
  102.  
  103. struct nfsd_statfsres {
  104.     struct statfs        stats;
  105. };
  106.  
  107. /*
  108.  * Storage requirements for XDR arguments and results.
  109.  */
  110. union nfsd_xdrstore {
  111.     struct nfsd_sattrargs    sattr;
  112.     struct nfsd_diropargs    dirop;
  113.     struct nfsd_readargs    read;
  114.     struct nfsd_writeargs    write;
  115.     struct nfsd_createargs    create;
  116.     struct nfsd_renameargs    rename;
  117.     struct nfsd_linkargs    link;
  118.     struct nfsd_symlinkargs    symlink;
  119.     struct nfsd_readdirargs    readdir;
  120. };
  121.  
  122. #define NFSSVC_XDRSIZE        sizeof(union nfsd_xdrstore)
  123.  
  124. void nfsd_xdr_init(void);
  125.  
  126. int nfssvc_decode_void(struct svc_rqst *, u32 *, void *);
  127. int nfssvc_decode_fhandle(struct svc_rqst *, u32 *, struct svc_fh *);
  128. int nfssvc_decode_sattrargs(struct svc_rqst *, u32 *,
  129.                 struct nfsd_sattrargs *);
  130. int nfssvc_decode_diropargs(struct svc_rqst *, u32 *,
  131.                 struct nfsd_diropargs *);
  132. int nfssvc_decode_readargs(struct svc_rqst *, u32 *,
  133.                 struct nfsd_readargs *);
  134. int nfssvc_decode_writeargs(struct svc_rqst *, u32 *,
  135.                 struct nfsd_writeargs *);
  136. int nfssvc_decode_createargs(struct svc_rqst *, u32 *,
  137.                 struct nfsd_createargs *);
  138. int nfssvc_decode_renameargs(struct svc_rqst *, u32 *,
  139.                 struct nfsd_renameargs *);
  140. int nfssvc_decode_linkargs(struct svc_rqst *, u32 *,
  141.                 struct nfsd_linkargs *);
  142. int nfssvc_decode_symlinkargs(struct svc_rqst *, u32 *,
  143.                 struct nfsd_symlinkargs *);
  144. int nfssvc_decode_readdirargs(struct svc_rqst *, u32 *,
  145.                 struct nfsd_readdirargs *);
  146. int nfssvc_encode_void(struct svc_rqst *, u32 *, void *);
  147. int nfssvc_encode_attrstat(struct svc_rqst *, u32 *, struct nfsd_attrstat *);
  148. int nfssvc_encode_diropres(struct svc_rqst *, u32 *, struct nfsd_diropres *);
  149. int nfssvc_encode_readlinkres(struct svc_rqst *, u32 *, struct nfsd_readlinkres *);
  150. int nfssvc_encode_readres(struct svc_rqst *, u32 *, struct nfsd_readres *);
  151. int nfssvc_encode_statfsres(struct svc_rqst *, u32 *, struct nfsd_statfsres *);
  152. int nfssvc_encode_readdirres(struct svc_rqst *, u32 *, struct nfsd_readdirres *);
  153.  
  154. int nfssvc_encode_entry(struct readdir_cd *, const char *name,
  155.                 int namlen, off_t offset, ino_t ino);
  156.  
  157. int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
  158.  
  159. #endif /* LINUX_NFSD_H */
  160.